<!--
 * @description  :零售户选择组件 
 * @descriptionDetail: 零售户选择组件
 * @copyright    : 浙江烟草
 * @author       : lcm
 * @create       : 2022-09-27 09:58:58
-->

<template>
  <view>
    <u-row gutter="16">
      <u-col span="12">
        <view class="title">
          <u-icon :label="client.targetName" size="30" name="../../static/check/licence.png" v-if="client.lossRecordUuid"></u-icon>
          <u-icon :label="client.targetName" size="30" name="../../static/check/nolicence.png" v-else></u-icon>
        </view>
      </u-col>
      <u-col span="12">
        <view class="sub-title">
          标准名称：{{ client.standardName }}
        </view>
      </u-col>
      <u-col span="12" >
        <view class="sub-title" v-if="repairType=='02'">
            扣分值：{{client.creditScore}}
        </view>
        <view class="sub-title">
           行为编码：{{client.targetCode}}
        </view>
        <view class="sub-title">
          失信修复状态：{{client.statusName}}
        </view>
        <view class="sub-title">
          最终信用等级：{{client.endCreditLevel}}
        </view>
        <view class="sub-title">
          标准信用等级：{{client.standardCreditLevel}}
        </view>
         <view class="sub-title">
          失信日期：{{client.lossDate}}
        </view>
        <view class="sub-title">
           惩戒截止日期：{{client.punishmentEndDate}}
          </view>
          <view class="sub-title" v-if="repairType=='02'">
          可修复日期：{{client.allowRepairDate}}
        </view>
        <view class="sub-title" v-if="repairType=='02'">
           备注：{{client.notAllowRepairReason}}
          </view>
      </u-col>
    </u-row>
  </view>
</template>
<script>
import checkService from "@/service/check/check.service"
export default {
  name: "ClientItem",
  props: {
    client: {
      type: Object,
      default: () => {},
    },
    repairType: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      tels: [],
    }
  },
  watch: {
    client: {
      immediate: true,
      handler() {
        this.$forceUpdate();
      },
    },
  },
  methods: {
    // 显示联系电话
    // handlerShowPhone(e) {
    //   if (this.tels.length > 0) {
    //     // 此处不能使用u-action-sheet，在u-swipe-action中使用时样式异常
    //     uni.showActionSheet({
    //       itemList: this.tels,
    //       itemColor: "#007aff",
    //       success: ({tapIndex,}) => this.doPhone(this.tels[tapIndex]),
    //     });
    //     return;
    //   }
    //   this.$u.loading("查询中...");
    //   checkService.retailerTels(this.client.retailerUuid).then(dr => {
    //     this.$u.hideLoading();
    //     if (dr.success) {
    //       let telDatas = dr.data;
    //       telDatas.forEach(t => {
    //         t.tel && this.tels.push(t.name + " " + t.tel);
    //       });
    //       uni.showActionSheet({
    //         itemList: this.tels,
    //         itemColor: "#007aff",
    //         success: ({tapIndex,}) => this.doPhone(this.tels[tapIndex]),
    //       });
    //     }
    //   });
    //   e.stopPropagation();
    //   e.preventDefault();
    // },
    // // 拨打电话
    // doPhone(telStr) {
    //   let tel = telStr.substring(telStr.indexOf(" "));
    //   this.$deviceApi.makePhoneCall(tel);
    // },
  },
}
</script>
<style lang="scss" scoped>
.title {
  font-size: 15px;
  color: #666;
  font-weight: 600;
  margin: 5px 10px;
}
.sub-title {
  color: #666;
  margin: 3px 10px;
}
</style>